//
//  XYUserHelper.h
//  PeiJue
//
//  Created by lxy on 2017/12/6.
//  Copyright © 2017年 lixiya. All rights reserved.
//

#import "XYDataReqHelper.h"

@protocol XYUserHelperDelegete <NSObject>
@optional
/** 登录成功 */
- (void)userDidLoginWithAuthToken:(NSString *)authToken;
/** 注册成功 */
- (void)userDidRegisterWithAuthToken:(NSString *)authToken;
/** 退出登录 */
- (void)userDidLogout;
/** 当所有的请求收到TOKEN过期时必须调用该方法做统一交互处理 */
- (void)needAuthByRequestTokenInvalid;

/** 更新未读消息数 */
- (void)unReadmessageUpdate;
@end


@protocol XYUserHelperDelegete;
@interface XYUserHelper : XYDataReqHelper
@property (nonatomic, assign, readonly, getter=isLogin) BOOL login;// 是否登录
@property (nonatomic, strong, readonly) NSString *token;

+ (instancetype)shareInstance;
- (void)addObserver:(id<XYUserHelperDelegete>)observer;
- (void)removeObserver:(id<XYUserHelperDelegete>)observer;


/** 当所有的请求收到TOKEN过期时必须调用该方法做统一交互处理 */
- (void)noticeNeedAuthByRequestTokenInvalid;

@end
